package InnerClass;

/**
 * @description:
 * @Author yyp
 * @time
 */
public class AnonymousInnerClassDetail {
    public static void main(String[] args) {
        Outer05 outer05 = new Outer05();
        outer05.f1();
    }
}
class Outer05{
    private int n1 = 99;
    public void f1(){
        //创建一个基于类的匿名内部类
        new Person(){
            @Override
            public void hi(){
                System.out.println("匿名内部类重写了hi方法");
            }
            @Override
            public void ok(String str){
                super.ok(str);
            }
        }.ok("test");
    }
}
class Person{
    public void hi(){
        System.out.println("Person hi()");
    }
    public void ok(String str){
        System.out.println("Person ok("+str+")");
    }
}
//抽象类/接口
